// type: 0 为菜单  1 为按钮
const addBtn = (code = 1) => ({ code, name: '新增', status: false, type: 1 })
const editBtn = (code = 2) => ({ code, name: '修改', status: false, type: 1 })
const deleteBtn = (code = 3) => ({ code, name: '删除', status: false, type: 1 })
const updateStatus = (code = 4) => ({ code, name: '启用/停用', status: false, type: 1 })
const otherBtn = (code, name) => ({ code, name, status: false, type: 1 })

export const authKey = [
  {
    code: 'a',
    name: '首页',
    path: '/dashboard',
    status: false,
    type: 0
  },
  {
    code: 'b',
    name: '部件管理',
    path: '/basicinfo/parts',
    status: false,
    type: 0,
    children: [
      {
        code: 1,
        name: '部件管理',
        path: '/basicinfo/parts/index',
        status: false,
        type: 0,
        children: [addBtn(), editBtn(), deleteBtn(), updateStatus()]
      },
      {
        code: 2,
        name: '部件类型设置',
        path: '/basicinfo/parts/type',
        status: false,
        type: 0,
        children: [addBtn(), editBtn(), deleteBtn(), updateStatus(), otherBtn(5, '属性配置')]
      }
    ]
  },
  {
    code: 'c',
    name: '设备管理',
    path: '/basicinfo/device',
    status: false,
    type: 0,
    children: [addBtn(), editBtn(), updateStatus(3), otherBtn(4, '导出')]
  },
  {
    code: 'd',
    name: '基础数据',
    path: '/basicinfo/basicdata',
    status: false,
    type: 0,
    children: [
      {
        code: 1,
        name: '居民注册',
        path: '/basicinfo/basicdata/resident',
        status: false,
        type: 0,
        children: [otherBtn(1, '拉黑/置为正常')]
      },
      {
        code: 2,
        name: '环境圈消息',
        path: '/basicinfo/basicdata/bbsTopic',
        status: false,
        type: 0,
        children: [otherBtn(1, ' 查看详情'), deleteBtn(2)]
      },
      {
        code: 3,
        name: '车辆管理',
        path: '/basicinfo/basicdata/car',
        status: false,
        type: 0,
        children: [addBtn(), editBtn(), deleteBtn(), updateStatus()]
      },
      {
        code: 4,
        name: '人员管理',
        path: '/basicinfo/basicdata/account',
        status: false,
        type: 0,
        children: [
          addBtn(), editBtn(), deleteBtn(), updateStatus(),
          otherBtn(5, '重置密码'),
          otherBtn(6, '下载模板'),
          otherBtn(7, '导入'),
          otherBtn(8, '导出')
        ]
      },
      {
        code: 5,
        name: '质量标准',
        path: '/basicinfo/basicdata/qualityStandard',
        status: false,
        type: 0,
        children: [addBtn(), editBtn(), deleteBtn(), updateStatus()]
      }
    ]
  },
  {
    code: 'e',
    name: '系统设置',
    path: '/basicinfo/system',
    status: false,
    type: 0,
    children: [
      {
        code: 1,
        name: '角色权限',
        path: '/basicinfo/system/role',
        status: false,
        type: 0,
        children: [addBtn(), editBtn(), deleteBtn(), otherBtn(4, '数据权限'), otherBtn(5, '操作权限')]
      },
      {
        code: 2,
        name: '组织架构',
        path: '/basicinfo/system/organization',
        status: false,
        type: 0,
        children: [
          otherBtn(1, '机构新增'),
          otherBtn(2, '机构修改'),
          otherBtn(3, '部门新增'),
          otherBtn(4, '部门修改'),
          otherBtn(5, '部门删除'),
          otherBtn(6, '岗位新增'),
          otherBtn(7, '岗位修改'),
          otherBtn(8, '岗位删除')
        ]
      }
    ]
  }
]
